﻿using FunArts.EasyDevOps.Shared.Models.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Shared.Models.SshClient.Command
{
    public class KeepAlivedCommand : ILinuxCommand
    {
        public KeepAlivedCommandTypeEnum KeepAlivedCommandType { get; set; }
        public string BuildCommand(SystemVersionTypeEnum systemVersionType)
        {
            switch (KeepAlivedCommandType)
            {
                case KeepAlivedCommandTypeEnum.Start:
                    return "sudo systemctl start keepalived";
                case KeepAlivedCommandTypeEnum.Stop:
                    return "sudo systemctl stop keepalived";
                case KeepAlivedCommandTypeEnum.Restart:
                    return "sudo systemctl restart keepalived";
                case KeepAlivedCommandTypeEnum.Reload:
                    return "sudo systemctl reload keepalived";
                case KeepAlivedCommandTypeEnum.Status:
                    return "sudo systemctl status keepalived";
                case KeepAlivedCommandTypeEnum.Enable:
                    return "sudo systemctl enable keepalived";
                case KeepAlivedCommandTypeEnum.Test:
                    return "sudo keepalived -t";
            }
            throw new NotImplementedException();
        }
    }
}
